/*!
 * \file MouseEvent.h
 * \brief Contains the definition of MouseEvent
 * \author CHOUVENC Guillaume, DE CHOULOT Guillaume, MATHIEU Fabien
 */

#ifndef MOUSEEVENT_H
#define MOUSEEVENT_H

#include "bga/system/Event.h"
#include "bga/window/Window.h"

/**
 * \namespace bga
 * \brief API namespace
 */
namespace bga
{

namespace MouseButton
{
    enum Code
    {
        NONE = -1,
        LEFT = 0,
        MIDDLE,
        RIGHT
    };
}

/*!
 * \brief Represents a Mouse Event
 *
 * This class represents a Mouse Event. It would detect if the mouse button have been pressed or released ans the coordinates.
 * This event would be get by a MouseListener
 */
class BOARD_HELL_ENGINE MouseEvent : public Event< bga::Window >
{
    private:

        MouseButton::Code code;   ///<! Contains the code of the button pressed or released
        unsigned int x;           ///<! Coordinate X of the mouse when the event has occured
        unsigned int y;           ///<! Coordinate Y of the mouse when the event has occured
        int delta;                ///<! Value generated by the wheel of the mouse

    public:

        /*!
         * \brief Contructor
         *
         * Default Contructor
         */
        MouseEvent();

        /*!
         * \brief Contructor
         * \param sender : Window which have sent the event
         *
         * Contructor with the sender
         */
        MouseEvent(const bga::Window &sender);

        /*!
         * \brief Destructor
         */
        virtual ~MouseEvent();


        /*!
         * \brief Setter of mouse button key used
         * \param code : Mouse button used
         *
         * Set the code of the mouse button used
         */
        void setMouseButton(MouseButton::Code code);

        /*!
         * \brief Getter of the mouse button used
         * \return the code of the mouse button used
         *
         * Return the code of the mouse button used
         */
        MouseButton::Code getMouseButton() const;

        /*!
         * \brief Setter of the Coordinate X
         * \param x : Coordinate X
         *
         * Set the code of the Coordinate X
         */
        void setX(unsigned int x);

        /*!
         * \brief Getter of the Coordinate X
         * \return the code of the Coordinate X
         *
         * Return the code of the Coordinate X
         */
        unsigned int getX() const;

        /*!
         * \brief Setter of the Coordinate Y
         * \param y : Coordinate Y
         *
         * Set the code of the Coordinate Y
         */
        void setY(unsigned int y);

        /*!
         * \brief Getter of the Coordinate Y
         * \return the code of the Coordinate Y
         *
         * Return the code of the Coordinate Y
         */
        unsigned int getY() const;

        /*!
         * \brief Getter of the Delta value of the wheel
         * \return the delta value
         *
         * Return the Delta value of the wheel
         */
        int getDeltaWheel() const;

        /*!
         * \brief Setter of the Delta value of the wheel
         * \param delta : the delta value
         *
         * Set the Delta value of the wheel
         */
        void setDeltaWheel(int delta);
};
}

#endif // MOUSEEVENT_H

